/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Diagnostico_vih.java
 *
 * Created on 30/03/2011, 03:19:46 PM
 */

package sistemaexperto_diagnostico_vih;

import javax.swing.JOptionPane;

/**
 *
 * @author isra
 */
public class Diagnostico_vih extends javax.swing.JFrame {

    /** Creates new form Diagnostico_vih */
    public Diagnostico_vih() {
        initComponents();
        setLocationRelativeTo(this);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        panel1 = new sistemaexperto_diagnostico_vih.Panel();
        jPanel1 = new javax.swing.JPanel();
        dolor_garganta = new javax.swing.JCheckBox();
        infec_herpes = new javax.swing.JCheckBox();
        glan_infla = new javax.swing.JCheckBox();
        dolor_cabeza = new javax.swing.JCheckBox();
        peso = new javax.swing.JCheckBox();
        diarrea = new javax.swing.JCheckBox();
        fiebre = new javax.swing.JCheckBox();
        rela_sexu = new javax.swing.JCheckBox();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        diagnostico = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        txt_diag = new javax.swing.JTextArea();
        diagnosticar = new javax.swing.JButton();
        jLabel10 = new javax.swing.JLabel();
        nuevo = new javax.swing.JButton();
        jLabel11 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        panel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGENES/VIHI.jpg"))); // NOI18N
        panel1.setLayout(null);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("SINTOMAS"));
        jPanel1.setOpaque(false);
        jPanel1.setLayout(null);

        dolor_garganta.setOpaque(false);
        jPanel1.add(dolor_garganta);
        dolor_garganta.setBounds(20, 300, 21, 21);

        infec_herpes.setOpaque(false);
        jPanel1.add(infec_herpes);
        infec_herpes.setBounds(20, 260, 21, 21);

        glan_infla.setOpaque(false);
        jPanel1.add(glan_infla);
        glan_infla.setBounds(20, 220, 21, 21);

        dolor_cabeza.setOpaque(false);
        jPanel1.add(dolor_cabeza);
        dolor_cabeza.setBounds(20, 180, 21, 21);

        peso.setOpaque(false);
        jPanel1.add(peso);
        peso.setBounds(20, 130, 21, 21);

        diarrea.setOpaque(false);
        jPanel1.add(diarrea);
        diarrea.setBounds(20, 90, 21, 21);

        fiebre.setOpaque(false);
        jPanel1.add(fiebre);
        fiebre.setBounds(20, 50, 21, 21);

        rela_sexu.setOpaque(false);
        jPanel1.add(rela_sexu);
        rela_sexu.setBounds(20, 20, 21, 21);

        jLabel2.setText("Ha tenido Relaciones Sexuales sin proteccion (sin condon)");
        jPanel1.add(jLabel2);
        jLabel2.setBounds(60, 20, 360, 14);

        jLabel3.setText("Fiebre que persite mas de un mes");
        jPanel1.add(jLabel3);
        jLabel3.setBounds(60, 50, 230, 14);

        jLabel4.setText("Dolor de garganta");
        jPanel1.add(jLabel4);
        jLabel4.setBounds(60, 300, 171, 14);

        jLabel5.setText("Diarrea que persiste mas de un mes");
        jPanel1.add(jLabel5);
        jLabel5.setBounds(60, 90, 260, 14);

        jLabel6.setText("Perdida de peso");
        jPanel1.add(jLabel6);
        jLabel6.setBounds(60, 130, 171, 14);

        jLabel7.setText("Dolor de cabeza");
        jPanel1.add(jLabel7);
        jLabel7.setBounds(60, 180, 171, 14);

        jLabel8.setText("Glandulas inflamadas");
        jPanel1.add(jLabel8);
        jLabel8.setBounds(60, 220, 171, 14);

        jLabel9.setText("Infeccion por herpes");
        jPanel1.add(jLabel9);
        jLabel9.setBounds(60, 270, 171, 14);

        panel1.add(jPanel1);
        jPanel1.setBounds(20, 50, 590, 340);

        jLabel1.setFont(new java.awt.Font("Algerian", 0, 48));
        jLabel1.setText("DIAGNOSTICO VIH");
        panel1.add(jLabel1);
        jLabel1.setBounds(120, 10, 410, 40);

        diagnostico.setBorder(javax.swing.BorderFactory.createTitledBorder("Diagnostico"));
        diagnostico.setOpaque(false);
        diagnostico.setLayout(null);

        txt_diag.setColumns(20);
        txt_diag.setEditable(false);
        txt_diag.setRows(5);
        txt_diag.setDisabledTextColor(new java.awt.Color(0, 0, 0));
        txt_diag.setEnabled(false);
        txt_diag.setOpaque(false);
        txt_diag.setRequestFocusEnabled(false);
        jScrollPane1.setViewportView(txt_diag);

        diagnostico.add(jScrollPane1);
        jScrollPane1.setBounds(10, 20, 570, 96);

        panel1.add(diagnostico);
        diagnostico.setBounds(20, 420, 590, 130);

        diagnosticar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGENES/diag.jpg"))); // NOI18N
        diagnosticar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                diagnosticarActionPerformed(evt);
            }
        });
        panel1.add(diagnosticar);
        diagnosticar.setBounds(260, 550, 70, 60);

        jLabel10.setText("nuevo");
        panel1.add(jLabel10);
        jLabel10.setBounds(370, 610, 90, 14);

        nuevo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGENES/mano.jpg"))); // NOI18N
        nuevo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nuevoActionPerformed(evt);
            }
        });
        panel1.add(nuevo);
        nuevo.setBounds(360, 550, 80, 60);

        jLabel11.setText("diagnosticar");
        panel1.add(jLabel11);
        jLabel11.setBounds(260, 610, 90, 14);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panel1, javax.swing.GroupLayout.DEFAULT_SIZE, 631, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panel1, javax.swing.GroupLayout.DEFAULT_SIZE, 626, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void diagnosticarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_diagnosticarActionPerformed

        if((rela_sexu.isSelected()==true)&&(infec_herpes.isSelected()==true)&&(fiebre.isSelected()==true)&&(peso.isSelected()==true)&&(dolor_cabeza.isSelected()==true)&&(glan_infla.isSelected()==true)&&(diarrea.isSelected()==true)&&(dolor_garganta.isSelected()==true)){
            txt_diag.setText("Ud es probable que tenga el virus VIH por tal motivo le recomendamos que se realize un "  + "\n"+
                    "examen de sangre y un examen de ELISA para mayor seguridad");
        }else if((rela_sexu.isSelected()==false)&&(infec_herpes.isSelected()==false)&&(fiebre.isSelected()==true)&&(peso.isSelected()==true)&&(dolor_cabeza.isSelected()==true)&&(glan_infla.isSelected()==true)&&(diarrea.isSelected()==false)&&(dolor_garganta.isSelected()==true)){
            txt_diag.setText("Ud tiene sintomas de la gripe le recomendamos ir al medico hacerse un examen");
        }else if((rela_sexu.isSelected()==true)&&(infec_herpes.isSelected()==false)&&(fiebre.isSelected()==true)&&(peso.isSelected()==false)&&(dolor_cabeza.isSelected()==true)&&(glan_infla.isSelected()==false)&&(diarrea.isSelected()==false)&&(dolor_garganta.isSelected()==false)){
             txt_diag.setText("Ud debe ir al medico para realizarse examenes");
        }else if((rela_sexu.isSelected()==false)&&(infec_herpes.isSelected()==false)&&(fiebre.isSelected()==false)&&(peso.isSelected()==false)&&(dolor_cabeza.isSelected()==false)&&(glan_infla.isSelected()==false)&&(diarrea.isSelected()==false)&&(dolor_garganta.isSelected()==false)){
             JOptionPane.showMessageDialog(null, "no tiene sintomas porfavor elija sus sintomas para darle un resultado de su enfermedad");
        }else if((rela_sexu.isSelected()==false)&&(infec_herpes.isSelected()==false)&&(fiebre.isSelected()==true)&&(peso.isSelected()==true)&&(dolor_cabeza.isSelected()==true)&&(glan_infla.isSelected()==false)&&(diarrea.isSelected()==false)&&(dolor_garganta.isSelected()==false)){
             txt_diag.setText("Ud tiene sintomas de principios de anemia le recomendamos ir al medico para que se realize  examenes ");
        }else if((rela_sexu.isSelected()==false)||(infec_herpes.isSelected()==false)||(fiebre.isSelected()==true)&&(peso.isSelected()==true)||(dolor_cabeza.isSelected()==true)||(glan_infla.isSelected()==true)||(diarrea.isSelected()==false)||(dolor_garganta.isSelected()==true)){
            txt_diag.setText("Ud no tiene sintomas del  VIH pero deberia ir al medico a realizar unos examenes");
        }
}//GEN-LAST:event_diagnosticarActionPerformed

    private void nuevoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nuevoActionPerformed
txt_diag.setText("");
rela_sexu.setSelected(false);
infec_herpes.setSelected(false);
fiebre.setSelected(false);
peso.setSelected(false);
dolor_cabeza.setSelected(false);
glan_infla.setSelected(false);
diarrea.setSelected(false);
dolor_garganta.setSelected(false);
        // TODO add your handling code here:
}//GEN-LAST:event_nuevoActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Diagnostico_vih().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton diagnosticar;
    private javax.swing.JPanel diagnostico;
    private javax.swing.JCheckBox diarrea;
    private javax.swing.JCheckBox dolor_cabeza;
    private javax.swing.JCheckBox dolor_garganta;
    private javax.swing.JCheckBox fiebre;
    private javax.swing.JCheckBox glan_infla;
    private javax.swing.JCheckBox infec_herpes;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton nuevo;
    private sistemaexperto_diagnostico_vih.Panel panel1;
    private javax.swing.JCheckBox peso;
    private javax.swing.JCheckBox rela_sexu;
    private javax.swing.JTextArea txt_diag;
    // End of variables declaration//GEN-END:variables

}
